﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace UFrame
{
    public class OUButtonDisable : MonoBehaviour, IPointerDownHandler
    {
        void Start()
        {
            var b = GetComponent<Button>();
            if (b != null)
            {
                b.onClick.AddListener(() => { gameObject.SetActive(false); });
            }
        }

        public void OnPointerDown(PointerEventData eventData)
        {
            gameObject.SetActive(false);
        }
    }
}